package com.voe.test;

import com.voe.VoEAudioProcessing;
import com.voe.VoEBase;
import com.voe.VoECodec;
import com.voe.VoEDtmf;
import com.voe.VoEExternalMedia;
import com.voe.VoEFile;
import com.voe.VoEHardware;
import com.voe.VoEVolumeControl;
import com.voe.VoiceEngine;
import com.voe.common.ReturnValue;

public class voe_test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		//VoiceEngine.setTraceFile("d:\\voe.log", false);
		int ret = 0;
		VoiceEngine voiceEngine = VoiceEngine.createInstance();
		VoEBase base = VoEBase.createInstance(voiceEngine);
		base.init(null);
		VoEAudioProcessing ap = VoEAudioProcessing.createInstance(voiceEngine);
		VoECodec codec = VoECodec.createInstance(voiceEngine);
		VoEVolumeControl vc = VoEVolumeControl.createInstance(voiceEngine);
		VoEDtmf dtmf = VoEDtmf.createInstance(voiceEngine);
		VoEExternalMedia em = VoEExternalMedia.createInstance(voiceEngine);
		VoEFile file = VoEFile.createInstance(voiceEngine);
		VoEHardware hw = VoEHardware.createInstance(voiceEngine); 
		int channel = base.createChannel();
		
		ReturnValue<Integer> loadPercent = new ReturnValue<Integer>();
		ret = hw.getSystemCPULoad(loadPercent);
		System.out.println("getSystemCPULoad:" + ret);
		System.out.println(loadPercent.getValue());
		
		base.deleteChannel(channel);
		base.terminate();
		base.release();
		codec.release();
		ap.release();
		vc.release();
		dtmf.release();
		em.release();
		file.release();
		hw.release();
		voiceEngine.release();
	}

}
